# Copyright (c) 2020 Presto Labs Pte. Ltd.
# Author: donggu

from fabric.api import env, put, local, run

env.user = 'bot-coin'
env.hosts = ['bastion.iosg.corp.prestolabs.io']
env.host = 'bastion.iosg.corp.prestolabs.io'
env.host_string = 'bot-coin@bastion.iosg.corp.prestolabs.io'
env.use_ssh_config = True


def build_and_deploy():
  local('bazel build //cc/appcoin2/support/feed:fastfeed_converter -c opt --strip=always')
  # local('bazel build //cc/appcoin2/support/feed:fastfeed_converter -c dbg')
  run('chmod +w /remote/iosg/home-2/bot-coin/coin2_fastfeed/fastfeed-converter')
  put('./bazel-bin/cc/appcoin2/support/feed/fastfeed_converter',
      '/remote/iosg/home-2/bot-coin/coin2_fastfeed/fastfeed-converter')


if __name__ == "__main__":
  build_and_deploy()
